import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;


public class WriteOnFile { 
	

	public static void main(String[] args) throws FileNotFoundException, UnsupportedEncodingException
	{
		ProblemWithoutMain problem =new ProblemWithoutMain();
		problem.index(2);
		Icon a=new Icon("rooma ");
		Icon b=new Icon("roomb");
		Icon c=new Icon("ball");
		Icon d=new Icon("left");

		c.setName("livingroom.jpg");
		b.setName("bedroom.jpg");
		a.setName("football.jpg");
		d.setName("Rebortarm.jpg");
  //MAHER: this is wrong. It looks you do not understand what I asked for.
  //MAHER: you need to look for the filename of each object's icon and write it in front of the object name in the problem instance file.
  //MAHER: You need to use the list of objects.
	PrintWriter writer = new PrintWriter("write.txt", "UTF-8");
	writer.println(problem.index(2)  +" ;; taken " + c.getName()  );
	writer.println(problem.index(6)  +" ;; taken " + a.getName()  );
	writer.println(problem.index(3)  +" ;; taken " + b.getName()  );
	writer.println(problem.index(4)  +" ;; taken " + d.getName()  );

	writer.close();
}

	

}